package com.imu.purse.modules.sys.entity;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.URL;

import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import com.imu.core.base.BaseEntity;

import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 轮播图配置表
 * 
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2017-11-06 17:17:24
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
@Data
@Table(name = "sys_carousel")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class SysCarouselEntity extends BaseEntity
{
	private static final long serialVersionUID = 1L;
	
	//主键ID
	@Id
	@Column(name="car_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotNull(message="主键不存在无法更新", groups = {UpdateGroup.class})
	private Long carId;
	
	//轮播图类型【字典】
	@Column(name="type")
	@NotBlank(message="请选择类型", groups = {AddGroup.class})
	private String type;
	
	//地址
	@Column(name="url")
	@NotBlank(message="请上传图片", groups = {AddGroup.class})
	@URL(message="图片地址有误，请重新上传", groups = {AddGroup.class})
	private String url;
	
	//描述
	@Column(name="remark")
	private String remark;
	
	//跳转链接
	@Column(name="ahref")
	@URL(message="跳转链接有误", groups = {AddGroup.class, UpdateGroup.class})
	private String ahref;
	
	//排序
	@Column(name="sort")
	@NotNull(message="请设置排序", groups = {AddGroup.class})
	private Integer sort;
	
	//状态：-1删除、0作废、1正常
	@Column(name="status")
	private Integer status;
	
	//上传人
	@Column(name="user_create")
	private Long userCreate;
	
	//上传时间
	@Column(name="time_create")
	private Date timeCreate;
	
	//修改人
	@Column(name="user_update")
	private Long userUpdate;
	
	//修改时间
	@Column(name="time_update")
	private Date timeUpdate;
	
	/**
	 * 设置：主键ID
	 */
	public void setCarId(Long carId) 
	{
		this.carId = carId;
	}
	
	/**
	 * 获取：主键ID
	 */
	public Long getCarId() 
	{
		return carId;
	}
	
	/**
	 * 设置：地址
	 */
	public void setUrl(String url) 
	{
		this.url = url;
	}
	
	/**
	 * 获取：地址
	 */
	public String getUrl() 
	{
		return url;
	}
	
	/**
	 * 设置：描述
	 */
	public void setRemark(String remark) 
	{
		this.remark = remark;
	}
	
	/**
	 * 获取：描述
	 */
	public String getRemark() 
	{
		return remark;
	}
	
	/**
	 * 设置：排序
	 */
	public void setSort(Integer sort) 
	{
		this.sort = sort;
	}
	
	/**
	 * 获取：排序
	 */
	public Integer getSort() 
	{
		return sort;
	}
	
	/**
	 * 设置：状态：-1删除、0作废、1正常
	 */
	public void setStatus(Integer status) 
	{
		this.status = status;
	}
	
	/**
	 * 获取：状态：-1删除、0作废、1正常
	 */
	public Integer getStatus() 
	{
		return status;
	}
	
	/**
	 * 设置：上传人
	 */
	public void setUserCreate(Long userCreate) 
	{
		this.userCreate = userCreate;
	}
	
	/**
	 * 获取：上传人
	 */
	public Long getUserCreate() 
	{
		return userCreate;
	}
	
	/**
	 * 设置：上传时间
	 */
	public void setTimeCreate(Date timeCreate) 
	{
		this.timeCreate = timeCreate;
	}
	
	/**
	 * 获取：上传时间
	 */
	public Date getTimeCreate() 
	{
		return timeCreate;
	}
	
	/**
	 * 设置：修改人
	 */
	public void setUserUpdate(Long userUpdate) 
	{
		this.userUpdate = userUpdate;
	}
	
	/**
	 * 获取：修改人
	 */
	public Long getUserUpdate() 
	{
		return userUpdate;
	}
	
	/**
	 * 设置：修改时间
	 */
	public void setTimeUpdate(Date timeUpdate) 
	{
		this.timeUpdate = timeUpdate;
	}
	
	/**
	 * 获取：修改时间
	 */
	public Date getTimeUpdate() 
	{
		return timeUpdate;
	}
}
